#include <stdio.h>

int
main(void)
{
	double x, a;
	double derivative = 0., val = 0., x_ = 1.;
	int i = 0;

	scanf("%lf", &x);

	while (scanf("%lf", &a) == 1) {
		if (i == 1 && x == 0.)
			derivative = a;
		else if (x != 0.)
			derivative += i * a * (x_ / x); //DivisionByZeroException
		val += x_ * a;
		x_ *= x;
		++i;
	}

	printf("%lf %lf\n", val, derivative);

	return 0;
}
